package cn.zyk.util;

import cn.zyk.entity.*;
import jakarta.servlet.http.*;
import lombok.extern.slf4j.*;
import org.springframework.beans.factory.annotation.*;


/**
 * @Author eHlw
 * @Date 2024/9/13 21:21
 * @description:
 */
@Slf4j
public class LoginUserUtil {
    @Autowired
    private HttpServletRequest request;

    public LoginUser getLoginUser() {
        String username = (String) request.getAttribute("username");
        String passwd = (String) request.getAttribute("passwd");
        LoginUser loginUser = new LoginUser();
        loginUser.setUserName(username);
        loginUser.setPassword(passwd);
        return loginUser;
    }

}
